<?php
class User_main extends CI_Controller
{
    public function __consruct(){
        
    }
     public function index($con)
     {
         $ar=array('add_user','add_couriers','list_user','list_courier');
          
          $this->template->write_view('header', 'header', array('title'=>'SHIP ORDER'), $overwrite = FALSE);
       /*  if(in_array($con,$ar)){
                 $id=$this->session->userdata('user_id');           
                  if(empty($id) or $id <= 0) {
                    $con='home';               
                  }
         }*/
         
            $this->template->write_view('sidebar', 'links', '', $overwrite = FALSE);
         $nav['navigation']=array('home');
         if($con !='home')
            array_push($nav['navigation'],$con);
         
         $this->template->write_view('content', $con, '', $overwrite = FALSE);       
        $this->template->write_view('navigation', 'navigation', $nav, $overwrite = FALSE);
        $this->template->write_view('footer', 'footer', '', $overwrite = FALSE);
        $this->template->render();
     }
     public function create(){
        
        
          $this->form_validation->set_rules(
            array(
                array('field' => 'user_email', 'label' => 'Email', 'rules' => 'trim|required'),
                array('field' => 'user_password', 'label' => 'Password', 'rules' => 'trim|required'), 
                ));
                
         if ($this->form_validation->run()==FALSE)
        {
               
              	$data['message'] = (validation_errors()) ? validation_errors() :'';
                 
             $this->template->write_view('content', 'add_user', $data, $overwrite = FALSE);
               redirect();
        } else
        {
              
               
        }   
     }
    
}
?>